<html>
<head>
  <meta charset="utf-8">
  <title>错误跳转</title>
  <link type="text/css" rel="stylesheet" href="error.css">
  <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
  <script>
      var a = document.getElementById('a');
      a = 5;
      console.log(a);
      var url = window.location.href;
      if(url != "http://liu.com/yuan/add/add.html"){
        alert("暂无数据,请先去添加条数据!");
        window.location.href = "http://liu.com/yuan/add/add.html";
      }
  </script>
</head>
<body>
  <p id="a"></p>
  <div class="error">
    <p class="title-error">错误提示</p>
    <hr/>
    <div class="content-error">
      当前页面未有数据!
    </div>
      <p class="msg-href" data="秒后自动跳转" id="time">1 </p>
  </div>
</body>
</html>
